package com.lantosec.hmrp.modules.system.vo;

import com.lantosec.hmrp.modules.system.entity.SysDept;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.system.entity.SysDeptPosition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * <p>
 * 部门表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysDept对象", description="部门表")
public class SysDeptVO extends BaseVO<SysDept> {
    private static final long serialVersionUID = 1L;


    public SysDeptVO(SysDept entity){
        this.deptId = entity.getDeptId();
        this.deptCode = entity.getDeptCode();
        this.deptName = entity.getDeptName();
        this.parentId = entity.getParentId();
        this.deptType = entity.getDeptType();
        this.leaf = entity.getLeaf();
        this.remark = entity.getRemark();
        this.positions = entity.getPositions();
        this.deptOrder = entity.getDeptOrder();
        this.flag = entity.getFlag();
    }

    @Override
    public SysDept convertToEntity(){
        return new SysDept(this);
    }


    @ApiModelProperty(value = "部门ID")
    private String deptId;

    @ApiModelProperty(value = "部门编码")
    private String deptCode;

    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @ApiModelProperty(value = "上级ID")
    private String parentId;

    @ApiModelProperty(value = "是否末级(0否1是)")
    private Integer leaf;

    @ApiModelProperty(value = "部门类型")
    private String deptType;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "职位列表")
    private String positions;

    @ApiModelProperty(value = "排序")
    private Integer deptOrder;

    @ApiModelProperty(value = "是否删除")
    private Boolean flag;

    @ApiModelProperty(value = "部门岗位列表")
    private List<SysDeptPosition> sysDeptPositionList;
    @ApiModelProperty(value = "岗位id")
    private String positionId;
}
